package com.nice.controller;

import com.nice.email.dto.vo.MailSendVo;
import com.nice.email.handler.IndexHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class EmailController {
    @Autowired
    private IndexHandler indexHandler;

    @RequestMapping("/sendEmail")
    @ResponseBody
    public String index(String addr) throws Exception
    {
        addr = "wjrsoftware@163.com";
        MailSendVo mailSendVo = indexHandler.index(addr);
        return null == mailSendVo ? "发送失败" : mailSendVo.toString();
    }
}
